home *** CD-ROM | disk | FTP | other *** search
- global gInputFieldSpr, gInputField, gPrevKeyInChars, oIndexScroller, gModeState, gAlphaState, gGlobalStepCount, gPrevTmOutScript, gKeyTmOutLengthK, gTimeRunningF, gIndxScrollFldK, gSearchState, oIndexMediator, gOurFontK, gHoldSearchInfo, oINTERfaceFind, gActiveWin, gIJustHitReturn, gTopicNameField, oImport
-
- on hInitInputParams
- set gInputField to the number of cast "searchtextcandidate"
- set the editableText of sprite gInputFieldSpr to 1
- set the keyDownScript to "hKeyCheck"
- set the text of field gInputField to " "
- set gPrevKeyInChars to EMPTY
- set gKeyTmOutLengthK to 60
- set the timeoutScript to EMPTY
- set gPrevTmOutScript to EMPTY
- set gIJustHitReturn to 0
- end
-
- on hKeyCheck
- global gEditKeys
- set vKey to the key
- set vKeyVal to charToNum(vKey)
- hKeyEventSupervisor()
- if gEditKeys then
- if the shiftDown and the commandDown and (vKey = ">") then
- hReadLinkFromList(1)
- return
- end if
- if the shiftDown and the commandDown and (vKey = "<") then
- hReadLinkFromList(-1)
- return
- end if
- end if
- if the shiftDown then
- if vKeyVal = 29 then
- hStepNext()
- return
- end if
- if vKeyVal = 28 then
- hStepPrev()
- return
- end if
- if vKeyVal = 30 then
- mIndexSliderKeyPage(oIndexScroller, -8)
- return
- end if
- if vKeyVal = 31 then
- mIndexSliderKeyPage(oIndexScroller, 8)
- return
- end if
- end if
- if the commandDown then
- if vKey = "F" then
- mPopSearchStrip(oINTERfaceFind)
- return
- end if
- if vKey = "Q" then
- hBolt()
- return
- end if
- if vKey = "W" then
- if vKey = "W" then
- hWinCloser()
- return
- end if
- return
- end if
- end if
- if vKey = RETURN then
- dontPassEvent()
- hSearchRequest()
- set gIJustHitReturn to 1
- return
- end if
- if gHoldSearchInfo then
- if (vKeyVal = 8) or (vKeyVal = 28) or (vKeyVal = 29) or (vKeyVal = 32) then
- if the shiftDown and (vKeyVal = 8) then
- put EMPTY into field gInputField
- else
- pass()
- end if
- else
- set vStart to the selStart
- set vend to the selEnd
- if vStart <> vend then
- put the key into char vStart + 1 to vend of field gInputField
- else
- put the key before char vStart + 1 of field gInputField
- end if
- hilite char 999 of field gInputField
- dontPassEvent()
- hKeyTimeMgr()
- set the selStart to vStart + 1
- set the selEnd to vStart + 1
- end if
- else
- if (gModeState = #ENCY) and not (the commandDown) then
- if (vKey >= "a") and (vKey <= "z") then
- hKeyCallAlph()
- end if
- end if
- end if
- end
-
- on hTopicKeys
- set vKey to the key
- set vKeyVal to charToNum(vKey)
- if the commandDown then
- if vKey = "Q" then
- hBolt()
- end if
- dontPassEvent()
- return
- end if
- if vKey = RETURN then
- dontPassEvent()
- if the text of field gTopicNameField <> EMPTY then
- mEnterNewName(oImport)
- end if
- return
- end if
- if (vKeyVal = 8) or (vKeyVal = 28) or (vKeyVal = 29) or (vKeyVal = 32) then
- if the shiftDown and (vKeyVal = 8) then
- put EMPTY into field gTopicNameField
- end if
- else
- if not "~@" contains the key then
- if the number of chars in field gTopicNameField < 41 then
- set vStart to the selStart
- set vend to the selEnd
- if vStart <> vend then
- put the key into char vStart + 1 to vend of field gTopicNameField
- else
- put the key before char vStart + 1 of field gTopicNameField
- end if
- hilite char 999 of field gTopicNameField
- dontPassEvent()
- set the selStart to vStart + 1
- set the selEnd to vStart + 1
- end if
- end if
- end if
- end
-
- on hWinCloser
- global oPWin
- if count(the windowList) then
- if string(the windowList) contains gActiveWin then
- mKeyVoiceClose(oPWin)
- end if
- end if
- end
-
- on hKeyTimeMgr
- if gTimeRunningF then
- set the timeoutLength to gKeyTmOutLengthK
- set gIJustHitReturn to 0
- else
- set gPrevTmOutScript to the timeoutScript
- set the timeoutLength to gKeyTmOutLengthK
- set the timeoutScript to "hTrackIndextoKey"
- set gTimeRunningF to 1
- end if
- end
-
- on hTrackIndextoKey
- set the timeoutScript to EMPTY
- set the timeoutScript to gPrevTmOutScript
- set gTimeRunningF to 0
- if gSearchState = #ENTRY then
- set Lstr to char 1 to 4 of field gInputField
- if Lstr = gPrevKeyInChars then
- return 0
- end if
- set L1 to char 1 of word 1 of Lstr
- if L1 <> gAlphaState then
- hSetMode(#ENCY)
- hputmsg(">hTrackIndextoKey requesting new Current Attr List")
- hGetNewAttrList(L1, 1)
- end if
- set gPrevKeyInChars to Lstr
- if gModeState = #EPIS then
- set Lthechars to hTweaktoTitle(gPrevKeyInChars)
- else
- set Lthechars to gPrevKeyInChars
- end if
- if (gModeState = #FoundSet) and (getAt(gTrackingModeslist, 6) = 0) then
- put "Sorry, there is no found entries at this time." into field "Status"
- else
- if not gIJustHitReturn then
- set Lthechars to string(Lthechars)
- if voidp(findPos(mGrabCurrAttrList(oIndexMediator, gModeState), Lthechars)) then
- set Lthechars to hTryCap(string(Lthechars))
- set Lnum to findPosNear(mGrabCurrAttrList(oIndexMediator, gModeState), Lthechars)
- else
- set Lnum to findPos(mGrabCurrAttrList(oIndexMediator, gModeState), Lthechars)
- end if
- end if
- end if
- mShiftWindowToEntry(oIndexScroller, Lnum, 1)
- end if
- end
-